﻿/*
 *	Copyright (c) 2009 Queensland University of Technology. All rights reserved.
 *	The QUT Bioinformatics Collection is open source software released under the 
 *	Microsoft Public License (Ms-PL): http://www.microsoft.com/opensource/licenses.mspx.
 */
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace QUT.Bio.Tags {

	public class StringCounter : IComparable<StringCounter> {
		private string value;
		private int frequency;

		public StringCounter(
			string value,
			int frequency
		) {
			this.value = value;
			this.frequency = frequency;
		}

		public int CompareTo( StringCounter other ) {
			#if false
				int result = other.frequency - this.frequency;
				return result == 0 ? other.value.CompareTo( this.value ) : result;
			#else
				return value.CompareTo( other.Value );
			#endif
		}

		public string Value {
			get {
				return value;
			}
		}

		public int Frequency {
			get {
				return frequency;
			}
		}

		public override string ToString() {
			return String.Format( "{0} ({1})", value, frequency );
		}
	}
}
